<template>
  <div>
    <p>计数：{{ count }}</p>
  </div>
</template>

<script>
import { EventBus } from "../../event-bus";
export default {
  name: "Second",
  data() {
    return {
      count: 0
    };
  },
  mounted() {
    // 通过EventBus.$on接收事件
    EventBus.$on("addition", params => {
      this.count = params.num;
    });
  }
};
</script>
